package com.wfh.easychat.model.enums;

import lombok.Getter;

/**
 * @Title: UserStatusEnum
 * @Author wangfenghuan
 * @Package com.wfh.easychat.model.enums
 * @Date 2025/9/26 15:05
 * @description: 用户状态枚举
 */
@Getter
public enum UserStatusEnum {

    /**
     * 用户状态枚举
     */
    BAN(0, "ban"),
    NORMAL(1, "normal");
    private final int code;
    private final String value;

    UserStatusEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static UserStatusEnum getByValue(String value) {
        for (UserStatusEnum userStatusEnum : UserStatusEnum.values()) {
            if (userStatusEnum.value.equals(value)) {
                return userStatusEnum;
            }
        }
        return null;
    }

}
